package com.cskaoyan.storagecreateproperties;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.stereotype.Component;

@Data
@Configuration
public class PropertiesConfiguration {
    @Value("${spring.mvc.static-path-pattern}")
    String pattern;
    @Value("${spring.web.resources.static-locations}")
    String location;
    @Value("${server.port}")
    String port;
    @Value("${ip}")
    String ip;
    @Bean
    public Path path(){
        Path path = new Path();
        path.setPattern(pattern);
        path.setLocation(location);
        path.setPort(port);
        path.setIp(ip);
        return path;
    }

}
